


var fanhui=document.querySelector('#fanhui');
window.onscroll= function (){
    console.log(document.documentElement.scrollTop);
    //老版本
    //|| document.body.scrollTop>1000
    if (document.documentElement.scrollTop > 1000){
        fanhui.style.display='block';
    }else {
        fanhui.style.display='none'
    }
};
fanhui.addEventListener('click',function (){
    //支持老版本
    //window.scrollTo(0,0);
    //新版本
    window.scrollTo({
        top: 0,
       behavior: 'smooth'
    });
});

var zhankai = document.querySelector("#zhankai");
var xiala1 = document.querySelector("#xiala1");


zhankai.addEventListener("mouseover",function(){
    console.log("123");
    xiala1.style.display= "block"
});

zhankai.addEventListener("mouseleave",function(){
    console.log("123");
    xiala1.style.display= "none"
});
xiala1.addEventListener("mouseover",function(){
    xiala1.style.display="block"
});


xiala1.addEventListener("mouseleave",function(){
    xiala1.style.display="none"
});











var nun = document.querySelector("#p2").innerHTML;
var ccc='a';
function zan(){
    nun = Number(nun);
    if (ccc=='a'){
        ccc='b'
    }else {
        ccc='a'
    }
    if (ccc=='b'){
        document.querySelector('#p2').innerHTML = nun+1
    }else {
        document.querySelector('#p2').innerHTML = nun
    }
}




var num = document.querySelector("#p1").innerHTML;
function guan(){
    num = Number(num);
    if (ccc=='o'){
        ccc='p'
    }else {
        ccc='o'
    }
    if (ccc=='p'){
        document.querySelector('#p1').innerHTML = num+1
    }else {
        document.querySelector('#p1').innerHTML = num
    }
}






var mySwiper = new Swiper ('.swiper-container', {
    loop: true, // 循环模式选项
    autoplay:true,
    // 如果需要分页器
    pagination: {
        el: '.swiper-pagination',
    },

    // 如果需要前进后退按钮
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },

});







